package com.qutan.app.core.domain;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 资讯
 * Created by pengweiyuan on 5/31/16.
 */
@Entity
@Table(name = "Info")
@DynamicInsert(value = true)
@DynamicUpdate(value = true)
public class Info extends IDEntity {

    @Column(columnDefinition = "bigint(11) comment '场景id' ")
    private long sceneId;

    @Column(columnDefinition = "varchar (40) comment '场景name'")
    private String sceneName;

    @Column(columnDefinition = "varchar (80) comment '标题'")
    private String title;

    @Column(columnDefinition = "varchar (500) comment '资讯内容'")
    private String content;

    @Column(columnDefinition = "varchar (500) comment '资讯的背景图（默认用场景的avatar）'")
    private String avatar;

    public long getSceneId() {
        return sceneId;
    }

    public void setSceneId(long sceneId) {
        this.sceneId = sceneId;
    }

    public String getSceneName() {
        return sceneName;
    }

    public void setSceneName(String sceneName) {
        this.sceneName = sceneName;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }


    public com.i7time.entity.Info conver2EntityInfo() {
        com.i7time.entity.Info info = new com.i7time.entity.Info(sceneId, sceneName, title, content, avatar);
        info.setId(this.id);
        return  info;
    }

    
}
